package ar.com.gals.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@SequenceGenerator(
	name = "gals_id_sequence", 
	sequenceName = "indice_id_seq", 
	allocationSize = 1
)
@Table(name="indice")
public class Indice extends Gals {

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "usuario_id", referencedColumnName = "id", nullable = false)
	private Usuario usuario;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "marca_id", referencedColumnName = "id", nullable = false)
	private Marca marca;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "rubro_id", referencedColumnName = "id", nullable = false)
	private Rubro rubro;
	
	@Column(name="descuento", nullable = false)
	private Float descuento;
	
	@Column(name="margen", nullable = false)
	private Float margen;

	
	public Usuario getUsuario() {
		return usuario;
	}
	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}
	public Marca getMarca() {
		return marca;
	}
	public void setMarca(Marca marca) {
		this.marca = marca;
	}
	public Rubro getRubro() {
		return rubro;
	}
	public void setRubro(Rubro rubro) {
		this.rubro = rubro;
	}
	public Float getDescuento() {
		return descuento;
	}
	public void setDescuento(Float descuento) {
		this.descuento = descuento;
	}
	public Float getMargen() {
		return margen;
	}
	public void setMargen(Float margen) {
		this.margen = margen;
	}
}
